home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.0 / Video Toaster v4.0.iso / programs / documentation / wordhost.doc < prev   
Text File  |  1994-10-07  |  2KB  |  56 lines

  1. /* WordHost -- The ARexx Spelling Checker Oct  7 1994
  2.  
  3.     Run WordHost from a shell with the name of a word list file as the only
  4. argument.  The included 'words' file works nicely.  The program is a small
  5. ARexx host which accepts commands sent to the port SPELLER_PORT.  The 2
  6. possible commands are __QUIT, which will terminate the host, or any other
  7. word, which will be sought in the words file.  If the word is found, the
  8. host will return 1 otherwise the result will be 0.  WordHost also acts as 
  9. a function host, with the sole function being Spell(word) which returns 1
  10. or 0.  The function host use is more elegant for longer scripts, whicl the
  11. command host behavior is handy for one-liners and sending commands from
  12. other applications.
  13.  
  14. These are handy aliases:
  15. alias spell rx "options results ; address SPELLER_PORT ; []; say result"
  16. alias spquit rx "address SPELLER_PORT __quit"
  17.  
  18. An example ARexx script follows... rx this file! */
  19.  
  20. /* The command host example.  this will actually run */
  21. options results
  22. address SPELLER_PORT
  23. arg line
  24. if line ="" then line = "The quick brown fpx jumped the lazy dog"
  25. say "Spell Checking: "line
  26. i=1
  27. w=word(line,i)
  28. do while(w~="")
  29.     i=i+1
  30.     w
  31.     if result=0 then say w" ain't spelt too good!"
  32.     else say w
  33.     w=word(line,i)
  34.     end
  35.  
  36.  
  37. /*   Function host version... possibly more convenient for scripts
  38. options results
  39. call addlib(SPELLER_PORT,0)
  40. arg line
  41. if line ="" then line = "The quick brown fpx jumped the lazy dog"
  42. i=1
  43. say "Spell Checking: "line
  44. w=word(line,i)
  45. do while(w~="")
  46.     i=i+1
  47.     if ~SPELL(w) then say w" ain't spelt too good!"
  48.     else say w
  49.     w=word(line,i)
  50.     end
  51. call remlib(SPELLER_PORT)
  52. */
  53.  
  54.  
  55.  
  56.